home *** CD-ROM | disk | FTP | other *** search
/ American History: Interactive Maps & User's Guide / American History: Interactive Maps & User's Guide.iso / pc / ImapTest.dxr / 00008_Done Button Script.ls < prev    next >
Encoding:
Text File  |  2000-01-25  |  1.9 KB  |  60 lines

  1. on mouseDown
  2.   global IMapTest
  3.   set TheirAnswer1 to getMyFirstAnswer(IMapTest)
  4.   set TheirAnswer2 to getMySecondAnswer(IMapTest)
  5.   set CurrentQuestionType to getCurrentType(IMapTest)
  6.   set doneSpriteNumber to getDoneSpriteNumber(IMapTest)
  7.   set barResponseSprite to getBarSpriteNumber(IMapTest)
  8.   set CurrentButton to the name of member the memberNum of sprite doneSpriteNumber
  9.   case CurrentButton of
  10.     "done_button":
  11.       if (CurrentQuestionType = 5) and (TheirAnswer1 <> 0) and (TheirAnswer2 <> 0) then
  12.         swapCast(doneSpriteNumber, "DoneNoSparkleDown")
  13.         puppetSound("click")
  14.       else
  15.         if (CurrentQuestionType <> 5) and (TheirAnswer1 <> 0) then
  16.           swapCast(doneSpriteNumber, "DoneNoSparkleDown")
  17.           puppetSound("click")
  18.         else
  19.           puppetSound("no click sound")
  20.           exit
  21.         end if
  22.       end if
  23.     "tryagain":
  24.       swapCast(doneSpriteNumber, "down-try again")
  25.       puppetSound("click")
  26.   end case
  27.   repeat while the mouseDown
  28.     nothing()
  29.   end repeat
  30.   set CurrentButton to the name of member the castNum of sprite doneSpriteNumber
  31.   case CurrentButton of
  32.     "DoneNoSparkleDown":
  33.       checkAnswer(IMapTest)
  34.     "down-try again":
  35.       repeat with i = 16 to 18
  36.         swapCast(i, "normal button")
  37.       end repeat
  38.       swapCast(barResponseSprite, "question.bar")
  39.       swapCast(30, "done_button")
  40.       if getQuestionNumber(IMapTest) = 1 then
  41.         swapCast(33, "DoneMessage.E")
  42.       end if
  43.       set TheirAnswer to 0
  44.     "RarrowOnly":
  45.       puppetSound("click")
  46.       set lIntCurrentQuestionNum to getQuestionNumber(IMapTest)
  47.       if lIntCurrentQuestionNum = 1 then
  48.         puppetSprite(33, 0)
  49.       end if
  50.       if lIntCurrentQuestionNum <> 10 then
  51.         initQuestionValues(IMapTest)
  52.       else
  53.         turnOffQuestioning(IMapTest)
  54.       end if
  55.       computeScore(IMapTest)
  56.       go(the frame + 1)
  57.   end case
  58.   updateStage()
  59. end
  60.